<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<!--edge浏览器H5兼容设置-->
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<!--360浏览器H5兼容设置-->
		<meta name="renderer" content="webkit" />
		<title>注册</title>
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<script src="../bootstrap3/jquery-1.9.1.min.js"></script>
	</head>
	<body>
		<div>
			<div>
				<p>新用户注册</p>
				<!--表单开始-->
				<form role="form" id="form-reg">
					<!--用户名-->
					<div>
						<label>名字：</label>
						<div>
							<input type="text"  placeholder="请输入用户名" name="adminName">
						</div>
					</div>
					<!--密码-->
					<div>
						<label> 密码：</label>
						<div class="col-md-8">
							<input type="text"  placeholder="请输入密码" name="password">
						</div>
					</div>
					<!--确认密码-->
					<div>
						<label> 确认密码：</label>
						<div class="col-md-8">
							<input type="text"   placeholder="请再次输入密码">
						</div>
					</div>
					<!--提交按钮-->
					<div>
						<label></label>
						<div>
							<input  type="button" value="立即注册" id="btn-reg"/>
							<span><small>已经有账号？</small><a href="login.html">登录</a></span>
						</div>
					</div>
				</form>
			</div>
		</div>
		<script type="text/javascript">
			$("#btn-reg").click(function () {
				$.ajax({
					"url":"/admin/reg",
					"data":$("#form-reg").serialize(),
					"type":"post",
					"dataType":"json",
					"success":function (json) {
						if(json.state===2000){
							alert("注册成功！");
						}else{
							alert("注册失败！"+json.message);
						}
					}
				})
			});
		</script>
	</body>

</html>